<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js">
    </script>
</head>
<body>
<div class="container">
    <form>
        <div class="form-group">
            <label for="exampleInputEmail1">Account</label>
            <input type="text"  class="form-control uname" id="exampleInputEmail1" >
        </div>
        <div class="form-group">
            <label for="exampleInputPassword1">Password</label>
            <input type="password"  class="form-control password" id="exampleInputPassword1">
        </div>
       <input type="hidden" class="token" name="__token__" value="{$Request.token}" />
        <button type="button" class="sub btn btn-primary">Submit</button>
    </form>
</div>
</body>
</html>
<script>
    $(".sub").on('click',function () {
        var uname = $(".uname").val();
        var  password = $(".password").val();
        var  token = $(".token").val();
        $.ajax({
            url:"http://www.yangxinpeng.com/login",
            method:"post",
            data:{uname:uname,password:password,__token__:token},
            success:function (res) {
                alert(res.msg);
                if (res.code == 200){
                    window.location.href="http://www.yangxinpeng.com/main"
                }
            }
        })
    })
</script>